package com.fr.lintcode;

import java.util.ArrayList;
import java.util.List;

public class Q822 {
    /**
     * @param head: the given linked list
     * @return: the array that store the values in reverse order 
     */
    public List<Integer> reverseStore(ListNode head) {
        // write your code here
    	List<Integer> rs = new ArrayList<>();
    	while(head != null) {
    		rs.add(0, head.val);
    		head = head.next;
    	}
    	return rs;
    }


}
